import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex)

const store = new Vuex.Store({

  state:{
    //教师课程列表
    teacherClass: [],
    //学生课程列表
    studentClass: [],
  },

  getters:{
    getTeacherClass(state){
      return state.teacherClass
    },
    getStudentClass(state){
      return state.studentClass
    },
  },

  mutations:{
    //设置教师课表数组
    setTeacherClass(state,name){
      state.teacherClass = name
    },
    setStudentClass(state,name){
      state.studentClass = name
    },

  },

  actions:{
    setTeacherClassList(context,name){
      context.commit("setTeacherClass",name)
    },
    setStudentClassList(context,name){
      context.commit("setTeacherClass",name)
    },

  },


})

export default store
